package com.tongji.diy.model
{
	import com.tongji.diy.model.furniturePlacementOptimization.OptimizationParameter;
	
	import de.polygonal.ds.DLinkedList;
	
	import flare.core.Pivot3D;
	
	import flash.geom.Matrix;
	import flash.geom.Point;

	public class FurnitureDataVO
	{
		public var furnitureIndex:uint;
		//包围盒，局部坐标
		private var _furnitureLength:Number;
		private var _furnitureWidth:Number;
		private var _furnitureHeight:Number;
		//家具类别
		private var _furnitureClass:int;
		//家具所在层，如果value == 1，则说明是底层家具，若value == 2，则说明是上层家具（例：电视柜（1），电视（2））
		//默认设置两层相互重叠摆放；value == 3， 说明家具是位于天花板上的
		private var _furnitureLayer:int;
		//全局坐标
	/*private var _furnitureMaxGlobal:Point = new Point();
		private var _furnitureMaxGlobal:Point = new Point();*/
		//即时值
		private var _x:Number = 0;//存贮的是全局坐标
		private var _y:Number = 0;
		private var _z:Number = 0;
		private var _rotation:Number = 0;
		private var _parentIndex:uint;
		
		public function FurnitureDataVO(furnitureIndex:uint, furnitureLength:Number, furnitureWidth:Number, furnitureHeight:Number, furnitureClass:int)
		{
			this.furnitureIndex = furnitureIndex;
			_furnitureLength = furnitureLength;
			_furnitureWidth =  furnitureWidth;
			_furnitureHeight = furnitureHeight;
			_furnitureClass = furnitureClass;
			setFurnitureLayer(_furnitureClass);
		}
		
		private function setFurnitureLayer(furnitureClass:int):void
		{
			switch(furnitureClass)
			{
				case OptimizationParameter.TV:
				case OptimizationParameter.VASE:
					_furnitureLayer = 2;
					break;
				case OptimizationParameter.CEILING_LAMP:
				case OptimizationParameter.AIRCONDITION:
					_furnitureLayer = 3;
					break;
				default:
					_furnitureLayer = 1;
			}
		}
		
		public function get parentIndex():uint
		{
			return _parentIndex;
		}
		
		public function get furnitureClass():int
		{
			return _furnitureClass;
		}
		
		public function get furnitureLayer():int
		{
			return _furnitureLayer;
		}
		
		public function get furnitureLength():Number
		{
			return _furnitureLength;
		}
		
		public function get furnitureWidth():Number
		{
			return _furnitureWidth;
		}
		
		public function get furnitureHeight():Number
		{
			return _furnitureHeight;
		}
		
		public function get x():Number
		{
			return _x;
		}
		
		public function get y():Number
		{
			return _y;
		}
		
		public function get z():Number
		{
			return _z;
		}
		
		public function get rotation():Number
		{
			return -_rotation;
		}
		public function set x(x:Number):void
		{
			_x = x;
		}
		
		public function set y(y:Number):void
		{
			_y = y;
		}
		
		public function set z(z:Number):void
		{
			_z = z;
		}
		
		public function set parentIndex(parentIndex:uint):void
		{
			_parentIndex = parentIndex;
		}
		
		public function set rotation(rotation:Number):void
		{
			_rotation = -rotation;
		}
	}
}